pandas show duplicate rows

117

pandas show duplicate rows -

import pandas as pd

# Show all rows that are duplicates based on the column 'col_x'

df[df.duplicated(['col_x'], keep=False)].sort_values(by=['col_x'])

python - show repeted values in a column -

df = df[df.duplicated(subset=['val1','val2'], keep=False)]

Comments

Submit
0 Comments